
import React from "react";
import Controller from "../Controller";

/** 窗口大小变化 */
export default function useResize(controller: Controller) {
    React.useEffect(() => {
        window.addEventListener('resize', controller.updateRendererSize);
        return () => {
            window.removeEventListener('resize', controller.updateRendererSize)
        }
    }, [controller.updateRendererSize])
}